<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 1. 对象的解构赋值
    // 2. 数组的解构赋值
    const obj = {
      info: 'hello',
      msg: 'nihao'
    }
    const { info, msg } = obj

    const arr = ['tom', 'jerry']
    const [a, b] = arr

    // 对象和数组的解构赋值的结合使用
    const arr1 = [{ info: 'tom'}]
    const [{ info }] = arr1

    function foo (callback) {
      callback([{isInterscting: true}])
    }

    foo(([{ isInterscting }]) => {
      if (isInterscting) {
        
      }
    })



  </script>
</body>
</html>
